#!/bin/bash

rounds=$1

base_args=" -cp .:bin/:lib/commons-cli-1.2.jar:jgap/lib/* br.edu.ufcg.ga.CaixeiroViajante -GO_GCO -GO_SMO -SMO_MR 0.05" 

run_exp()
{

	other_args=$1
	dir_name="exp_$other_args"
	dir=`echo $dir_name | sed -e 's/ //g'`
	mkdir "$dir"
	for i in `seq 1 $rounds`
	do
		java $base_args $other_args
	done
	cat output-*.out > $dir/result.txt
	mv *.out "$dir"
}


# BestChromosomes scenarios

#selector_rates="0.9 1"

for sr in $selector_rates
do
	other_args="-NS_BCS -BCS_DCA true -BCS_SR $sr"
	run_exp "$other_args"
done

# Tournament scenarios

#tournament_sizes="1 2 3 4 5"
tournament_sizes="9"

selector_rates="0.9"

for sr in $selector_rates
do
	for ts in $tournament_sizes 
	do
		other_args="-NS_TS -TS_DCA true -TS_SR $sr -TS_TS $ts"
        	run_exp "$other_args"
	done

done 

# Roulette scenario

other_args="-WRS"
#run_exp "$other_args"

